package com.lhz;

import com.lhz.manager.JobManager;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @Author: LiHuaZhi
 * @Date: 2020/8/31 17:40
 * @Description: 启动完成后加载
 **/
@Component
@Slf4j
public class JobApplicationRunner implements ApplicationRunner {


    @Resource
    private JobManager jobManager;

    @Override
    public void run(ApplicationArguments args) {
        log.info("==== 系统运行开始 ====");

        // 设置注册信息
        jobManager.registryJob();

        // 初始化任务
        jobManager.initJob();
    }
}
